package edu.zac.controller;

import edu.zac.pojo.Emp;
import edu.zac.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import java.io.IOException;

/**
 * @Title
 * @Author Peihan.Zhang
 * @Email zhangpeihan@sjgtw.com
 * @Date 2021/10/18 20:09
 * @Versions 1.0
 */
@Controller
public class EmpController {
    @Autowired
    @Qualifier(value="emp")
    private Emp emp;
    @Autowired
    @Qualifier(value="empServiceImp")
    private EmpService empService;


    public void addEmp() throws IOException {
        try {
            System.out.println(this.emp);
            empService.addEmp(this.emp);
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("controller出问题了");
            throw  e;
        }
    }
}
